//
//  RightViewController.m
//  Doc Ebook
//
//  Created by Hai Nguyen on 9/30/12.
//  Copyright (c) 2012 Hai Nguyen. All rights reserved.
//

#import "RightViewController.h"

@interface RightViewController ()

@end

@implementation RightViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
		[self.navigationController setNavigationBarHidden:YES animated:YES];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self goToLibraryViewController];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

- (void)dealloc
{
    [super dealloc];
}

static RightViewController *m_Instance;
+ (RightViewController *)shared
{
    if ( !m_Instance ) {
        m_Instance = [[RightViewController alloc] init];
    }
    return m_Instance;
}

- (void)goToNewsViewController
{
    //[self.navigationController removeFromParentViewController];
    NewsViewController *newsViewController = [[NewsViewController alloc] init];
    [self.navigationController addChildViewController:newsViewController];
    [newsViewController release];

}

- (void)goToLibraryViewController
{
    //[self.navigationController removeFromParentViewController];
    LibraryViewController *libViewController = [[LibraryViewController alloc] init];
    [self.navigationController addChildViewController:libViewController ];
    [libViewController release];
}
@end
